class Person {
    name: String
    doList: Array<String>
    type: String
    constructor(type: string, name: string, doList: string[]) {
        this.type = type
        this.name = name
        this.doList = doList
    }
    static create(name: string) {
        switch (name) {
            case 'Student':
                return new Person('student', name, [])
            case 'Teacher':
                return new Person('teacher', name, [])
            default:
                throw new Error('类型错误')
        }
    }
}
export default Person